#pragma once
#include "singleton.hpp"
#include "sink.hpp"
#include "attribute.hpp"
#include <vector>
#include <map>


class Core 
	: public singleton<Core>
{
public:
	void add_sink(const std::shared_ptr<sink>& sink_ptr)
	{
		auto iter = std::find(sink_vec_.begin(), sink_vec_.end(), sink_ptr);
		if (iter != sink_vec_.end())
			return;

		sink_vec_.emplace_back(sink_ptr);
	}

	void add_global_attribute(std::string name, attribute_value value) 
	{
		auto iter = attri_map_.find(name);
		if (iter != attri_map_.end())
			return;

		attri_map_.emplace(std::make_pair(name, value));
	}

private:
	std::vector<std::shared_ptr<sink>> sink_vec_;
	std::map<std::string, attribute_value> attri_map_;
};